package io.renren.modules.user.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.user.dao.TPeopleNoticeDao;
import io.renren.modules.user.entity.TPeopleNoticeEntity;
import io.renren.modules.user.service.TPeopleNoticeService;


@Service("tPeopleNoticeService")
public class TPeopleNoticeServiceImpl extends ServiceImpl<TPeopleNoticeDao, TPeopleNoticeEntity> implements TPeopleNoticeService {

    @Autowired
    private TPeopleNoticeDao tPeopleNoticeDao;


    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<TPeopleNoticeEntity> page = this.page(
                new Query<TPeopleNoticeEntity>().getPage(params),
                new QueryWrapper<TPeopleNoticeEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<TPeopleNoticeEntity> findNotice(TPeopleNoticeEntity noticeEntity) {
        List<TPeopleNoticeEntity> noticeList = tPeopleNoticeDao.findNotice(noticeEntity);
        return noticeList;
    }

    @Override
    public List<TPeopleNoticeEntity> findNoticeDept(String peopleId, String roleId, String deptId) {
        List<TPeopleNoticeEntity> noticeDept = tPeopleNoticeDao.findNoticeDept(peopleId, roleId, deptId);
        return noticeDept;
    }

    @Override
    public List<TPeopleNoticeEntity> findPeopleNotice(String peopleId) {
        List<TPeopleNoticeEntity> noticeList = tPeopleNoticeDao.findPeopleNotice(peopleId);
        return noticeList;
    }

}